package Sort_Code;

public class Recursiondemo2 {
    //需求：利用递归求5的阶乘
    public static void main(String[] args) {
        int sum=recursion(5);
        System.out.println(sum);
    }

    private static int recursion(int i) {
        if(i==1){
            return 1;
        }
        else{
            return i*recursion(i-1);
        }
    }

}
